﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using NQueries.Data;
using NQueries.Data.Queries;
using TestModel;

namespace TestConsole
{
    public class QueryTest : Query<IAdventureWorksEntities, IEnumerable<Product>>
    {
        protected override Expression<Func<IAdventureWorksEntities, IEnumerable<Product>>> Expression
        {
            get
            {
                return context => from product in context.Products
                                      .Include(x => x.ProductCategory)
                                      .Include(x => x.SalesOrderDetails)
                                  where product.SalesOrderDetails.Count() > 0
                                  select product;
            }
        }
    }
}